/*
*  Copyright 2020-2021 Li Fei
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.pengshun.modules.api.coal.domain;

import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Date;

/**
* @description /
* @author lifei
* @date 2020-11-13
**/
@Entity
@Data
@Table(name="ps_user_address")
public class UserAddress implements Serializable {

    @Column(name = "sp_id",nullable = false)
    @ApiModelProperty(value = "省份id")
    private Integer spId;

    @Column(name = "sc_id",nullable = false)
    @ApiModelProperty(value = "城市id")
    private Integer scId;

    @Column(name = "sd_id",nullable = false)
    @NotNull
    @ApiModelProperty(value = "区县id")
    private Integer sdId;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "user_address_id")
    @ApiModelProperty(value = "用户地址id")
    private Long userAddressId;
    private Long userId;

    @Column(name = "name",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "收货人")
    private String name;

    @Column(name = "phone",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "收货人电话")
    private String phone;

    @Column(name = "address",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "详细地址")
    private String address;

    @Column(name = "is_default")
    @ApiModelProperty(value = "是否默认(0不默认1默认)")
    private Integer isDefault;

    @ApiModelProperty(value="纬度")
    @Column(name = "lng_x")
    private Double lngX;

    @ApiModelProperty(value="经度")
    @Column(name = "lat_y")
    private Double latY;

    @ApiModelProperty(value="1正常  2删除")
    private Integer status;


    private  String province;
    private  String city;
    private  String district;

    private Date createTime;

}